<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="${root!}/static/css/layout.css" rel="stylesheet"
	type="text/css" />
<link href="${root!}/static/css/skin.css" rel="stylesheet"
	type="text/css" />
<link href="${root!}/static/css/tree.css" rel="stylesheet"
	type="text/css" />

<script src="${root!}/static/Js/jquery-1.4.2.js" type="text/javascript"></script>

<script src="${root!}/static/js/layout.js" type="text/javascript"></script>

<script src="${root!}/static/js/tree.js" type="text/javascript"></script>

<script src="${root!}/static/js/dialog.js" type="text/javascript"></script>

<script src="${root!}/static/js/form.js" type="text/javascript"></script>


<script>
	var RootPath = "${root!}";
	var FormCodeUrl = RootPath + "/components/tree";
	//展示树
	var TreeQuery = "/read";
	var FormTreeId = "Tree1";
	
	//树扩展属性
	var treeData="${treeData!}";
	var initData="${initData!}";
	TreeSelectObject=eval(decodeURIComponent(decodeURIComponent(initData)));
	
	var topLevelValue = "0";
	var isLazy = false;
	var selectType = "${selectType!}";
	var expandType = "${expandType!}";
	var onlyLeafSelect = ${onlyLeafSelect!};
	
	$(function() {
		ShowTree();
		PrintSelectBox();
	});
	
    function ReturnSelectTree() {

        var json = "";
        var count = TreeSelectObject.length;
        for (var i = 0; i < count; i++) {

            var obj = TreeSelectObject[i];

            json += ",";

            //对象序列化成字符串
            var item = $.param(obj);
            item = decodeURIComponent(item);
            item = item.replace(/&/g, "','");
            item = item.replace(/=/g, "':'");
            item = "{'" + item + "'}";

            json += escape(item);
        }

        if (json.length > 0) {
            json = json.substring(1);
        }

        ReturnDialogValue(json);
    }
	
</script>

<style>
    .selectitem
    {
        background-color: #EEEEEE;
        margin-bottom: 2px;
        display: inline;
        float: left;
        cursor: pointer;
    }
    .SelectTitle
    {
        margin-left: 8px;
        float: left;
        display: inline;
        font-weight: bold;
        overflow: hidden;
    }
    .SelectButton
    {
        color: #0000FF;
        cursor: pointer;
        text-decoration: underline;
        text-align: center;
    }
</style>

</head>
<body>
	<form id="myform">
	    <div class="container">
	        <div class="hiddencalc fullheight w4">
	        </div>
	        <div class="fullheight calcwidth">
	            <div class="fullwidth">
	                <div class="buttonGroup h30">
	                    <input type="button" value="确定" id="btnSelect" onclick="ReturnSelectTree();" />
	                    <input type="button" value="取消" id="btnCancel" onclick="CloseWindow();" />
	                </div>
	            </div>
	            <div class="hiddencalc fullwidth h4">
	            </div>

	            <div class="formcontainer fullwidth h30">
	                <div class="label halfwidth">
	                    <font class="labeltext fullwidth" style="text-align: center;">全部列表</font>
	                </div>
	                <div class="label halfwidth">
	                    <font class="labeltext fullwidth" style="text-align: center;">已选择列表</font>
	                </div>
	            </div>
	            <div id="content" class="fullwidth calcheight">
	                <div class="fullheight halfwidth onlyscrolly">
	                    <div id="Tree1"></div>
	                </div>
	                <div class="fullheight halfwidth onlyscrolly">
	                    <div class="formcontainer selectgroup fullwidth" id="SelectContainer">
	                        <div class="selectitem fullwidth h30">
	                            <div class="calcwidth fullheight">
	                                <font class="SelectTitle"><a href="#text_99">已选择一</a></font></div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">上移</font>
	                            </div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">下移</font>
	                            </div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">删除</font>
	                            </div>
	                        </div>
	                        <div class="selectitem fullwidth h30">
	                            <div class="calcwidth fullheight">
	                                <font class="SelectTitle"><a href="#text_1">已选择二</a></font></div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">上移</font>
	                            </div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">下移</font>
	                            </div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">删除</font>
	                            </div>
	                        </div>
	                        <div class="selectitem fullwidth h30">
	                            <div class="calcwidth fullheight">
	                                <font class="SelectTitle">已选择三</font></div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">上移</font>
	                            </div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">下移</font>
	                            </div>
	                            <div class="fullheight w30">
	                                <font class="SelectButton fullwidth">删除</font>
	                            </div>
	                        </div>
	                    </div>
	                </div>
	            </div>
	            <div class="hiddencalc fullwidth h4">
	            </div>
	        </div>
	        <div class="hiddencalc fullheight w4">
	        </div>
	    </div>
	</form>
</body>
</html>
